from playwright.sync_api import Page

def getElements(page: Page, locatorExpression):
    try:
        elements = page.locator(locatorExpression)
        return elements
    except Exception as err:
        raise err